package de.jmda.util.gui.fx;

import java.net.MalformedURLException;
import java.net.URL;

import javax.lang.model.element.Element;

import de.jmda.gui.ImageFilenameFactory;

public abstract class ImageURLFactory
{
	public static URL getImageURL(Element element, String filenameSuffix)
	{
		URL result;

		try
		{
			result =
					new URL(
							ImageFilenameFactory.getImageFilename(element, filenameSuffix));
		}
		catch (MalformedURLException e)
		{
			throw new IllegalArgumentException(
					"failure creating " + URL.class.getName() + " instance", e);
		}

		return result;
	}
}